<div id="module_title" >
    <span>Tìm Kiếm Phòng</span>
</div>
<div id="system-message-container">
    <?php

        if(empty($success)  === false ){
            echo $success[0];
        }

        if(empty($errors)  === false ){
            echo $errors[0];
        }
    ?>
</div>
<form action="" method="post" name="frmSearchRoom" id="frmSearchRoom" class="searchform" >
    <table class="adminlist">
        <tr>
            <td>

                <label class="lbl-search" for="s">Nhập tên phòng:</label>
                <input type="text" name="s" id="s" placeholder="Ví dụ: P3.02" class="txt-search"  value="<?php echo $s; ?>" />
                <button type="submit" name="btnSearchRoom" id="btnSearchRoom" class="btn-search" >Tìm</button>

            </td>
        </tr>
    </table>
</form>
<table class="adminlist">
    <thead>
        <tr>
            <th width="2%" >#</th>
            <th class="left" >
                Tên Phòng
            </th>
            <th class="left">
                Mô Tả
            </th>
            <th class="left" >
                Trạng Thái
            </th>
            <th  colspan="2">Chức năng</th>
        </tr>
    </thead>
    <tbody>
    <?php if (isset( $rooms ) && !empty($rooms) ): ?>
        <?php
        $stt = 0;
        foreach ($rooms as $room):
        if($stt % 2 == 0){
            $class='row0';
        } else {
            $class='row1';
        }
        ?>
        <tr class="<?php echo $class; ?>" >
            <td><?php echo $stt + 1; ?></td>
            <td><?php echo $room['room_name']; ?></td>
            <td><?php echo $room['room_desc']; ?></td>
            <td style="text-align: center;" >
                <?php if ( $room['room_status'] == 0 ): ?>
                    <span style="color: green; font-weight: bold;" >Bình Thường</span>
                <?php else: ?>
                    <span style="color: red; font-weight: bold;" >Đang Bảo Trì</span>
                <?php endif ?>
            </td>
            <td class="center"  ><a href="index.php?mod=room&act=edit&id=<?php echo $room['room_id']; ?>">Sửa</a></td>
            <td class="center" ><a onclick="if(!confirm(\'Bạn có chắc muốn xoá!\')) return false;" href="index.php?mod=room&act=del&id=<?php echo $room['room_id']; ?>">Xoá</a></td>
        </tr>
        <?php endforeach ?>
    <?php else: ?>
        <tr><td colspan="6" >Không tìm thấy dữ liệu.</td></tr>
    <?php endif ?>
    </tbody>
    <tfoot>

    </tfoot>
</table>